import '@tarojs/async-await';
import Taro, { Component } from '@tarojs/taro';
import { Provider } from '@tarojs/redux';
import dva, { setScene } from './dva';
import Index from './pages/index';
import './utils/sa';
import './custom-variables.scss';
import './asset/style/index.styl';
import { wxApi } from '@lansezhaji/weapp-utils';

const dvaApp = dva.createApp({});

const store = dvaApp.getStore();

class App extends Component {
    config = {
        pages: [
            'pages/index/index', //首页
            'pages/oilList/index', //加油记录
            'pages/price/index', //今日油价
            'pages/mine/index', //个人中心
            'pages/create/index', // 创建
            'pages/detail/index', // 详情
            'pages/car/index', // 汽车列表
            // 'pages/tipList/index', // tip列表
            'pages/tipDetail/index', // tip详情
            'pages/station/index', // tip详情
            'pages/report/index', // 我的月度报告
            'pages/maintenance/index', // 新增保养记录
            'pages/createMaintain/index', // 新增保养记录
            'pages/ads/index', // 广告页
            'pages/record/index', // 其他记账项目
            'pages/recordList/index', // 记账列表
        ],
        

        window: {
            backgroundTextStyle: 'light',
            navigationBarBackgroundColor: '#fff',
            navigationBarTitleText: '企鹅医生健康商店',
            navigationBarTextStyle: 'black',
            navigationStyle: 'custom',
            backgroundColor: '#ffffff'
        },
        tabBar: {
            color: '#1d1e1f',
            selectedColor: '#00c365',
            backgroundColor: '#ffffff',
            list: [
                {
                    pagePath: 'pages/index/index',
                    text: '首页',
                    iconPath: './asset/imgs/tabBar/home.png',
                    selectedIconPath: './asset/imgs/tabBar/home_active.png',
                },
                {
                    pagePath: 'pages/oilList/index',
                    text: '加油记录',
                    navigationBarBackgroundColor: '#00c365',
                    iconPath: './asset/imgs/tabBar/oil.png',
                    selectedIconPath: './asset/imgs/tabBar/oil_active.png',
                },
                {
                    pagePath: 'pages/mine/index',
                    text: '我的',
                    iconPath: './asset/imgs/tabBar/me.png',
                    selectedIconPath: './asset/imgs/tabBar/me_active.png',
                },
                
            ]
        },
        navigateToMiniProgramAppIdList: [
            'wxb693d15b88599ba4',
        ],
        'permission': {
            'scope.userLocation': {
                'desc': '你的位置信息将用于活动地点定位'
            }
        },
        'requiredPrivateInfos': ['getLocation'],
        '__usePrivacyCheck__': true
 
    };

    componentDidMount(){
        // 检查更新
        wxApi.checkUpdate();
    }
    render() {
        return (
            <Provider store={store}>
                <Index />
            </Provider>
        );
    }
}

Taro.render(<App />, document.getElementById('app'));
